package com.coolgor.axnut.enums.lordsee;


public enum ScanSegmentOperationStateEnum {
	SUCCESS(1000, "操作成功"),
	INNER_ERROR(-1001, "内部系统错误"),
	NULL(-1002, "获取数据为空"),
	NULL_ID(-1003, "ID为空"),
	INSERT_ERROR(-1004, "插入失败"),
	UPDATE_ERROR(-1005, "更新失败"),
	DELETE_ERROR(-1006, "删除失败"),
	EMPTY_LIST(-1009, "数据列表为空");

	private int state;

	private String stateInfo;

	private ScanSegmentOperationStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static ScanSegmentOperationStateEnum stateOf(int index) {
		for (ScanSegmentOperationStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
}
